import { defineUserConfig } from 'vuepress/cli'
import { viteBundler } from '@vuepress/bundler-vite'
import * as sass from 'sass'
import { defaultTheme } from '@vuepress/theme-default'

export default defineUserConfig({
  lang: 'en-US',
  locales: {
    '/': {
      lang: 'en-US',
      title: 'My first VuePress Site',
      description: 'My first VuePress Site',
    },
    '/zh/': {
      lang: 'zh-CN',
      title: '我的第一个 VuePress 网站',
      description: '我的第一个 VuePress 网站',
    },
  },
  theme: defaultTheme({
    logo: 'https://vuejs.press/images/hero.png',

    locales: {
      '/': {
        selectLanguageText: 'Languages',
        selectLanguageName: 'English',
        navbar: [
          { text: 'Home', link: '/' },
          { text: 'Tools', link: '/tools' }
        ],
      },
      '/zh/': {
        selectLanguageText: '选择语言',
        selectLanguageName: '简体中文',
        navbar: [
          { text: '首页', link: '/zh/' },
          { text: '工具', link: '/zh/tools' }
        ],
      },
    },
  }),

  bundler: viteBundler({
    viteOptions: {
      css: {
        preprocessorOptions: {
          scss: {
            implementation: sass,
          },
        },
      },
    },
  }),
})